package com.itfitness.mchart.utils;

import com.hyphenate.easeui.domain.EaseUser;
import com.hyphenate.easeui.utils.EaseCommonUtils;

import java.util.Hashtable;
import java.util.List;
import java.util.Map;

/**
 * @ProjectName: MChart
 * @Package: com.itfitness.mchart.utils
 * @ClassName: ListUtil
 * @Description: java类作用描述 ：获取各种列表的工具类
 * @Author: 作者名：lml
 * @CreateDate: 2019/4/26 11:10
 * @UpdateUser: 更新者：
 * @UpdateDate: 2019/4/26 11:10
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */

public class ListUtil {
    /**
     * 获取联系人列表
     * @param list 通过接口获取的联系人列表
     * @return
     */
    public static Map<String,EaseUser> getContactList(List<String> list){
        Map<String,EaseUser> users = new Hashtable<String, EaseUser>();
        for(String username : list){
            EaseUser easeUser = new EaseUser(username);
            EaseCommonUtils.setUserInitialLetter(easeUser);
            users.put(username, easeUser);
        }
        return users;
    }
}
